package ZY11_20;

import java.io.*;

public class Test2 {
    public static void main(String[] args) {
        FileInputStream fis=null;
        BufferedReader br=null;
        String a=null;
        String b=null;
        try {
            InputStreamReader isr=new InputStreamReader(new FileInputStream(
                    "D:\\javaceshi\\data.txt"));
            br=new BufferedReader(isr);
            a=br.readLine();
            int f=Integer.parseInt(a);
            while ((b=br.readLine())!=null){
                int c=Integer.parseInt(b);
                if (c>f){
                    f=c;
                }
            }
            System.out.println("最大值为："+f);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            try {
                br.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
